In recent years, a computer system, a so-called embedded system, that is incorporated into various types of machines and equipment to perform control for realization of a particular function, is being watched with interest, and its applied fields are expanding. Embedded software used for the embedded system is required to have so-called real-time performance that performs processing by responding within a predetermined time period after accepting a request for processing. Therefore, the embedded system often adopts a real time OS (Operating System).
As described above, the real time OS must ensure a response within a predetermined time period. Therefore, there is adopted as indispensable technology a so-called multithread function or multitask function that a single application process is divided into plural processing units and the execution rights are switched thereby processing in parallel at the same time. Here, one processing unit which is a substance to execute the program is generally called a process.
When plural processes are switched, “contexts” used for processing in the processes performed by the CPU are generally switched. Here, the contexts are associated with the respective processes and include a current flag status of a register set (a general purpose register, a floating-point register, a status register, a program counter, and the like) and information for execution of the respective processes. When the contexts are switched, it is necessary to store the context of the process having been executed and to read the context of the process to be executed newly. The time required to perform the switching operation is called overhead, and the overhead is generated every time the context is switched.
As technology to reduce the overhead required when the contexts are switched by the real time OS on the physical machine, for example, Japanese Patent Laid-Open No. 07-141208 “Multi-task processor” describes a multitask processor using the real time OS. Specifically, there is described a method that plural register banks to be occupied in corresponding with the respective processes are disposed, and the context save/restore is performed by switching the register banks, thereby the schedule time is reduced.
This problem of the overhead related to the switching of the contexts is not limited to the physical machine but also involved in a virtualization layer VMM (Virtual Machine Monitor) of the virtual machine system. Generally, the VMM treats the logical CPU of each VM (Virtual Machine) as one process, and plural active processes are included in the system at the same time, thereby realizing real time performance. Therefore, the context save/restore processing at the time of switching the processes in the VMM becomes the system overhead.
Technology related to a context save/restore processing in a virtual machine system that operates plural OSs on a physical machine is described in, for example, Japanese Patent Laid-Open No. 2001-282558 “Multi-operating computer system”.
Japanese Patent Laid-Open No. 2001-282558 has plural OSs simultaneously not by a VM system in which the VMM emulates hardware but by a system in which an OS switching program is disposed outside of the OS to distribute the interruption. As technology to reduce the overhead of the context save/restore at the time of switching the OSs, there is described a system wherein the OSs are provided with a communication handler function, and a processing request among the OSs is processed by interrupting.
The method for overhead reduction to switch the context for a physical machine described in the above-described Japanese Patent Laid-Open No. 07-141208 “Multi-task processor” is also applicable to the VMM of the virtual machine system. Since the application of the relevant method does not generate a context save/restore processing to an external memory, it becomes possible to realize a high-speed switching of the context accordingly. But, since the hardware resource provided as a register bank is generally limited, a system having many contexts to be treated such as a virtual machine system has an amount of register which becomes necessary as the register bank and becomes enormous, and it cannot be said that it is a very realistic structure.
Since the method described in Japanese Patent Laid-Open No. 2001-282558 involves a modification of OS, it is also necessary to modify the application operating on it, and it has a problem that an application significant for business might fail to operate.
An object of the present invention is to reduce overhead due to switching of contexts without involving a modification of OS or the like in a virtual machine system according to a VM method.